function addRecord(s,t) {
	var l = getObj(t).lastChild;
	var n = getObj(s).cloneNode(true);
	n.style.display = '';
	n.id = '';
	getObj(t).insertBefore(n,l);
}
function delRecord(s,t,o) {
	getObj(t).removeChild(o.parentNode.parentNode);
	if (getObj(t).getElementsByTagName('TR').length<=2)addRecord(s,t);
}
function delGroup(ajaxUrl,groupid,usernum) {
	usernum = usernum-0;
	if (usernum) {
		showDialog('error','此经纪人会员组有经纪人，不能删除');
		exit;
	}
	if(confirm('是否确认删除该经纪人用户组？')) {
		ajax.send(ajaxUrl,'action=delete&groupid='+groupid,function(){
				var str = ajax.request.responseText.split("\t");
				if (str[0] == 'success'){
					showDialog('success','删除成功!',3);
					window.location.href = ajaxUrl;
				} else if (str[0] == 'haveuser') {
					showDialog('error','此经纪人会员组有经纪人，不能删除');
				} else {
					showDialog('error','删除失败');
				}
			}
		);
	}
}